package com.asm.repository;

import com.asm.entity.sys.Tag;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author morningbear
 * @description 定义标签操作的接口
 * @date 2019/7/12
 */
@Repository
public interface TagRepository extends JpaRepository<Tag, Long> {

    /**
     * 查询所有标签
     *
     * @param pageRequest 分页
     * @return Page<Tag>
     */
    @Query("select c from Tag c where c.isDel=false")
    Page<Tag> findAll(PageRequest pageRequest);
}
